package com.ptma.model;

import java.io.Serializable;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.OneToMany;
import javax.persistence.Table;

import org.hibernate.annotations.Cascade;
import org.hibernate.annotations.CascadeType;

@Entity
@Table(name = "DEVICE")
public class Device implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	@Id
	@GeneratedValue
	@Column(name = "device_id")
	private Long id;
	@Column(name = "have_camera")
	private boolean camera;

	@Column(name = "have_mic")
	private boolean mic;

	@Column(name = "have_bluetooth")
	private boolean bluetooth;

	@Column(name = "screen_width")
	private float screenWidth;

	@Column(name = "screen_height")
	private float screenHeight;

	@Column(name = "have_gps")
	private boolean gps;

	@Column(name = "dpi")
	private float dpi;

	@Column(name = "manufacturer")
	private String vendor;

	@Column(name = "custom_name")
	private String name;

	@Column(name = "unique_id")
	private String uuid;

	@Column(name = "ram_size")
	private String ramSize;

	@Column(name = "os")
	private String os;

	@Column(name = "push_notification_id")
	private String pushNotificationId;

	@OneToMany
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@JoinColumn(name = "fk_device_id", referencedColumnName = "device_id")
	private List<Installation> installations;

	@OneToMany
	@Cascade(value = { CascadeType.SAVE_UPDATE })
	@JoinColumn(name = "fk_device_id", referencedColumnName = "device_id")
	private List<Notification> notifications;

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public boolean isCamera() {
		return camera;
	}

	public void setCamera(boolean camera) {
		this.camera = camera;
	}

	public boolean isMic() {
		return mic;
	}

	public void setMic(boolean mic) {
		this.mic = mic;
	}

	public boolean isBluetooth() {
		return bluetooth;
	}

	public void setBluetooth(boolean bluetooth) {
		this.bluetooth = bluetooth;
	}

	public float getScreenWidth() {
		return screenWidth;
	}

	public void setScreenWidth(float screenWidth) {
		this.screenWidth = screenWidth;
	}

	public float getScreenHeight() {
		return screenHeight;
	}

	public void setScreenHeight(float screenHeight) {
		this.screenHeight = screenHeight;
	}

	public boolean isGps() {
		return gps;
	}

	public void setGps(boolean gps) {
		this.gps = gps;
	}

	public float getDpi() {
		return dpi;
	}

	public void setDpi(float dpi) {
		this.dpi = dpi;
	}

	public String getVendor() {
		return vendor;
	}

	public void setVendor(String vendor) {
		this.vendor = vendor;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getRamSize() {
		return ramSize;
	}

	public void setRamSize(String ramSize) {
		this.ramSize = ramSize;
	}

	public String getOs() {
		return os;
	}

	public void setOs(String os) {
		this.os = os;
	}

	public String getPushNotificationId() {
		return pushNotificationId;
	}

	public void setPushNotificationId(String pushNotificationId) {
		this.pushNotificationId = pushNotificationId;
	}

	public List<Installation> getInstallations() {
		return installations;
	}

	public void setInstallations(List<Installation> installations) {
		this.installations = installations;
	}

	public List<Notification> getNotifications() {
		return notifications;
	}

	public void setNotifications(List<Notification> notifications) {
		this.notifications = notifications;
	}

}
